<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>每日数据</title>
</head>
<style>
    *{
        margin: 0; padding: 0;
        list-style: none;
        text-decoration:none;
    }
    #total>h1
        { text-align: center;}
    #container
        {
        margin: 0px auto;
        width: 1000px;height: auto;
        position: relative;
    }
    table
        { margin: 0 auto;}
    #left
        {
        height:150px;
        position: fixed; left: 100px; top: 200px;
        width: 150px; padding-left: 50px
    }
    a:link {
        font-size: 12px;
        color: #000000;
        text-decoration: none;
    }
    a:visited {
        color: #000000;
        text-decoration: none;
    }
    a:hover {
        color: #999999;
        text-decoration: none;
    }
    .ccc, #zerodataname{
        color: mediumvioletred !important;
    }
    .ccc a{
        color: mediumvioletred !important;
    }
    .zero{
        margin-left: 450px;
    }
    .recover{
        margin-right: 450px;
    }

</style>
<body>
    <div id="container">
        <div id="left">
            <ul>
                <li style="font-size: 16px">最近日期</li>
                {% for eachdate in date01 %}
                <li><a href='http://127.0.0.1:8080/check/{{ eachdate }}/'>{{ eachdate }}</a></li>
                {% endfor %}
            </ul>
        </div>


        <div>
            <div id="total" ><h1>{{ data }}数据</h1></div>
            <center><div style=float:left;><button value="0数据" class="zero" onclick="hide()">零数据</button></div></center>
            <center><div><button value="还原" class="recover">还原</button></div></center>
            <table border="0">
                <thead>
                    <tr>
                    <th>标题</th>
                    <th>数据量</th>
                    </tr>
                </thead>
        <tbody>

        {% for say in says %}
        <tr class = "spider", id='aaa'>
            <td style="font-size: 20px"><a href="{{ say['url'] }}" target="_blank">{{ say['title'] }}</a></td>
            <td>{{ say['number'] }}</td>
        </tr>

        {% endfor %}
        <tr style="display: none" id="zerodataname" >
        <td>今天0数据站点合计为: </td>
        <td name="countdata" id = 'zerodata'></td>
        </tr>

        </tbody>
        </table>
        </div>


    </div>

</body>
    <script src = 'https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'></script>
    <script>


        window.onload = function() {
            var each_data = document.getElementsByClassName('spider');
            for (i=0; i<each_data.length; i++){
                if (each_data[i].childNodes[3].innerHTML == 0){
                    each_data[i].setAttribute('class','ccc');
                    i--;
                }
            }
        };

        $(document).ready(function(){
            $(".zero").click(function(){
            $(".spider").hide();
            var count = document.getElementsByClassName('ccc').length;
            document.getElementById('zerodata').innerHTML = count;
            document.getElementById('zerodataname').style.display = 'block';
            });

            $(".recover").click(function(){
            $(".spider").show();
            document.getElementById('zerodataname').style.display = 'none';
            });
        });


    </script>
</html>